﻿using System;
using System.Net;
using System.Reflection;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace UI.Web.SL.Demo.Infrastructure
{
    public class Utility
    {
        public static void ConvertObject(object source, object dest)
        {
            foreach (PropertyInfo p in dest.GetType().GetProperties())
            {
                Object originalValue = p.GetValue(source, null);
                Object newValue = p.GetValue(source, null);
                if (originalValue != null && newValue != null
                    && originalValue.Equals(newValue))
                {
                    continue;
                }
                p.SetValue(source, originalValue, null);
                p.SetValue(source, newValue, null);
            }
        }
    }
}
